﻿package com.janisRadins.asDraw {
	import com.janisRadins.asDraw.vo.CurveData;
	
	/**
	 * @author Jānis Radiņš
	 */
	public interface ICurveCollection {
		/**
		 * Number of curves in ICurveCollection instance
		 */
		function get curveCount():uint
		/**
		 * Current index of iterator
		 */
		function get curveIndex():uint
		/**
		 * Method which returns curve instance at some index
		 * @param	index
		 * @return 	ICurve
		 */
		function getCurveAt(index:int):ICurve
		/**
		 * Method that adds Curve to collection at specific index
		 * @param	curve Curve instance to be added
		 * @param	index Value in range -curveCount to curveCount which specify at which index Curve should be added
		 */
		function setCurveAt(curve:Curve, index:int):void
		/**
		 * Method that change Curve position in collection
		 * @param	curve Curve instance which exists in collection
		 * @param	oldIndex Index of curve which should be moved
		 * @param	newIndex Value in range -curveCount to curveCount which specify at which index Curve should be added
		 */
		function changeCurveIndex(oldIndex:int, newIndex:int):void
		/**
		 * Method that removes all specific Curve instances from collection
		 * @param	curve Reference to Curve instance in collection that should be removed
		 * @return Curve that has been removed
		 */
		function removeCurve(curve:Curve):ICurve
		/**
		 * Method that removes Curve from collection by index
		 * @param	index Value in range -curveCount to curveCount which specify at which index Curve should be added
		 * @return Curve that has been removed
		 */
		function removeCurveAt(index:int):ICurve
		/**
		 * Method that returns flag on wether Curve is contained by collection
		 * @param	curve Curve that should be checked
		 * @return Boolean flag, true if Curve is inside collection or false if not
		 */
		function contains(curve:Curve):Boolean
		/**
		 * Method that returns data about ICurve position inside ICurveCollection
		 * @param	curve
		 * @return	CurveData
		 */
		function getCurveData(curve:ICurve):CurveData
		/**
		 * Method that returns flag whether theres more curves to fetch beyond <code>curveIndex</code>
		 * @return Boolean
		 */
		function get hasNext():Boolean
		/**
		 * Method that returns next ICurve instance
		 * @return ICurve
		 */
		function getNext():ICurve
		/**
		 * Method that returns flag whether theres more curves to fetch before <code>curveIndex</code>
		 * @return Boolean
		 */
		function get hasPrev():Boolean
		/**
		 * Method that returns previouse ICurve instance
		 * @return ICurve
		 */
		function getPrev():ICurve
		/**
		 * Method that resets curveIndex to begining of curve collection
		 */
		function resetToStart():void
		/**
		 * Method that sets curveIndex to end of curve collection
		 */
		function resetToEnd():void
	}
}